home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / DS-1.ZIP;1 / H.ZIP / CPUCONF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-10  |  8.9 KB  |  302 lines

  1. /*
  2.  *  Configuration parameters that depend on computer architecture.
  3.  *  Some depend on values defined in config.h, which is always
  4.  *  included before this file.
  5.  */
  6.  
  7. #ifndef CStateSize
  8. #define CStateSize 15            /* size of C state for co-expressions */
  9. #endif                    /* CStateSize */
  10.  
  11. /*
  12.  * The following definitions depend on the sizes of ints and pointers.
  13.  */
  14.  
  15. /*
  16.  * Most of the present implementations use 32-bit "words".  The section
  17.  *  for 64-bit words is tentative and untested.  16-bit words are no
  18.  *  longer supported.  Note that WordBits is the number of bits in an Icon
  19.  *  integer, not necessarily the number of bits in an int (given by IntBits).
  20.  *  For example, in MS-DOS an Icon integer is a long, not an int.
  21.  *
  22.  *  MaxStrLen must not be so large as to overlap flags.
  23.  */
  24.  
  25. /*
  26.  * 64-bit words.  NOTE:  This section is under construction!
  27.  */
  28.  
  29. #if WordBits == 64
  30.  
  31. #ifndef MinLong
  32. #define MinLong  ((long int)0x8000000000000000) /* smallest long integer */
  33. #endif
  34.  
  35. #ifndef MaxLong
  36. #define MaxLong  ((long int)0x7fffffffffffffff) /* largest long integer */
  37. #endif
  38.  
  39. #define MaxDigits 40        /* maximum number of digits in images */
  40. #define MaxStrLen 017777777777L /* maximum string length */
  41.  
  42. #ifndef MaxNegInt
  43. #define MaxNegInt "-9223372036854775808"
  44. #endif
  45.  
  46. #ifndef F_Nqual
  47. #define F_Nqual 0x8000000000000000    /* set if NOT string qualifier */
  48. #endif                    /* F_Nqual */
  49. #ifndef F_Var
  50. #define F_Var    0x4000000000000000    /* set if variable */
  51. #endif                    /* F_Var */
  52. #ifndef F_Ptr
  53. #define F_Ptr    0x1000000000000000    /* set if value field is pointer */
  54. #endif                    /* F_Ptr */
  55. #ifdef F_Typecode
  56. #define F_Typecode  0x2000000000000000    /* set if dword includes type code */
  57. #endif                    /* F_Typecode */
  58.  
  59. #endif                    /* WordBits == 64 */
  60.  
  61. /*
  62.  * 32-bit words.
  63.  */
  64.  
  65. #if WordBits == 32
  66.  
  67. #define MaxLong  ((long int)017777777777L)   /* largest long integer */
  68. #define MinLong  ((long int)020000000000L)   /* smallest long integer */
  69. #define MaxDigits 20        /* maximum number of digits in images */
  70.  
  71. #define MaxNegInt "-2147483648"
  72.  
  73. #define MaxStrLen         0777777777    /* maximum string length */
  74.  
  75. #define F_Nqual 0x80000000        /* set if NOT string qualifier */
  76. #define F_Var    0x40000000        /* set if variable */
  77. #define F_Ptr    0x10000000        /* set if value field is pointer */
  78. #define F_Typecode  0x20000000    /* set if dword includes type code */
  79. #endif                    /* WordBits == 32 */
  80.  
  81. /* Values that depend on the number of bits in an int (not necessarily
  82.  * the same as the number of bits in a word).
  83.  */
  84.  
  85. #if IntBits == 64
  86. #define LogIntBits            6    /* log of IntBits */
  87. #define MaxUnsigned 01777777777777777777777L /* largest unsigned integer */
  88. #define MaxInt         0777777777777777777777L /* largest int */
  89. /*
  90.  * Cset initialization and access macros.
  91.  */
  92. #define fwd(w0, w1, w2, w3) \
  93.  ((w0)&0xffff | ((w1)&0xffff)<<16 | ((w2)&0xffff)<<32 | ((w3)&0xffff)<<48)
  94. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  95.  {fwd(w0,w1,w2,w3),fwd(w4,w5,w6,w7),fwd(w8,w9,wa,wb),fwd(wc,wd,we,wf)}
  96. #define Cset32(b,c) (*CsetPtr(b,c)>>(32*CSetOff((b)>>5)))  /* 32 bits of cset */
  97. #endif                    /* IntBits == 64 */
  98.  
  99. #if IntBits == 32
  100. #define LogIntBits            5    /* log of IntBits */
  101. #define MaxUnsigned      037777777777    /* largest unsigned integer */
  102. #define MaxInt           07777777777    /* largest int */
  103. /*
  104.  * Cset initialization and access macros.
  105.  */
  106. #define twd(w0,w1)    ((w0)&0xffff | (w1)<<16)
  107. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  108.     {twd(w0,w1),twd(w2,w3),twd(w4,w5),twd(w6,w7), \
  109.      twd(w8,w9),twd(wa,wb),twd(wc,wd),twd(we,wf)}
  110. #define Cset32(b,c) (*CsetPtr(b,c))    /* 32 bits of cset */
  111. #endif                    /* IntBits == 32 */
  112.  
  113. #if IntBits == 16
  114. #define LogIntBits                4    /* log of IntBits */
  115. #define MaxUnsigned ((unsigned int)0177777)    /* largest unsigned integer */
  116. #define MaxInt              077777    /* largest int */
  117.  
  118. #ifndef MaxListSlots
  119. #define MaxListSlots 8000        /* largest list-element block */
  120. #endif                    /* MaxListSlots */
  121.  
  122. /*
  123.  * Cset initialization and access macros.
  124.  */
  125. #define cset_display(w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf) \
  126.     {w0,w1,w2,w3,w4,w5,w6,w7,w8,w9,wa,wb,wc,wd,we,wf}
  127. #define Cset32(b,c) (((unsigned long)(unsigned int)(*CsetPtr((b)+16,c))<<16) | \
  128.    ((unsigned long)(unsigned int)(*CsetPtr(b,c))))  /* 32 bits of cset */
  129. #endif                    /* IntBits == 16 */
  130.  
  131. #ifndef LogHuge
  132. #define LogHuge 309            /* maximum base-10 exp+1 of real */
  133. #endif                    /* LogHuge */
  134.  
  135. #ifndef Big
  136. #define Big 9007199254740992.        /* larger than 2^53 lose precision */
  137. #endif                    /* Big */
  138.  
  139. #ifndef Precision
  140. #define Precision 10            /* digits in string from real */
  141. #endif                    /* Precision */
  142.  
  143. /*
  144.  * Parameters that configure tables and sets:
  145.  *
  146.  *  HSlots    Initial number of hash buckets; must be a power of 2.
  147.  *  LogHSlots    Log to the base 2 of HSlots.
  148.  *
  149.  *  HSegs    Maximum number of hash bin segments; the maximum number of
  150.  *        hash bins is HSlots * 2 ^ (HSegs - 1).
  151.  *
  152.  *        If Hsegs is increased above 12, the arrays log2h[] and segsize[]
  153.  *        in the runtime system will need modification.
  154.  *
  155.  *  MaxHLoad    Maximum loading factor; more hash bins are allocated when
  156.  *        the average bin exceeds this many entries.
  157.  *
  158.  *  MinHLoad    Minimum loading factor; if a newly created table (e.g. via
  159.  *        copy()) is more lightly loaded than this, bins are combined.
  160.  *
  161.  *  Because splitting doubles the number of hash bins, and combining halves it,
  162.  *  MaxHLoad should be at least twice MinHLoad.
  163.  */
  164.  
  165. #ifndef HSlots
  166. #if IntBits == 16
  167. #define HSlots     4
  168. #define LogHSlots  2
  169. #else
  170. #define HSlots     8
  171. #define LogHSlots  3
  172. #endif                    /* IntBits */
  173. #endif                    /* HSlots */
  174.  
  175. #if ((1 << LogHSlots) != HSlots)
  176. Deliberate Syntax Error -- HSlots and LogHSlots are inconsistent
  177. #endif                    /* HSlots / LogHSlots consistency */
  178.  
  179. #ifndef HSegs
  180. #if IntBits == 16
  181. #define HSegs      6
  182. #else
  183. #define HSegs     10
  184. #endif                    /* IntBits */
  185. #endif                    /* HSegs */
  186.  
  187. #ifndef MinHLoad
  188. #define MinHLoad  1
  189. #endif                    /* MinHLoad */
  190.  
  191. #ifndef MaxHLoad
  192. #define MaxHLoad  5
  193. #endif                    /* MaxHLoad */
  194.  
  195. /*
  196.  * The number of bits in each base-B digit; the type DIGIT (unsigned int)
  197.  *  in rt.h must be large enough to hold this many bits.
  198.  *  It must be at least 2 and at most WordBits / 2.
  199.  */
  200.  
  201. #define NB           (WordBits / 2)
  202.  
  203. /*
  204.  * Memory sizing. 
  205.  */
  206.  
  207. #ifdef FixedRegions
  208. #undef IconAlloc
  209. #ifndef AlcMax
  210. #define AlcMax 25
  211. #endif                    /* AlcMax */
  212. #endif                    /* FixedRegions */
  213.  
  214. /*
  215.  * Maximum sized block that can be allocated (via malloc() or such).
  216.  */
  217.  
  218. #ifndef MaxBlock
  219. #define MaxBlock MaxUnsigned
  220. #endif                    /* MaxBlock */
  221.  
  222. /*
  223.  * What follows is default memory sizing. Implementations with special
  224.  *  requirements may specify these values in define.h.
  225.  */
  226.  
  227. #ifndef MaxStatSize
  228. #ifdef Coexpr
  229. #define MaxStatSize        20480    /* size of the static region in bytes*/
  230. #else                    /* Coexpr */
  231. #define MaxStatSize         1024    /* size of the static region in bytes */
  232. #endif                    /* Coexpr */
  233. #endif                    /* MaxStatSize */
  234.  
  235. #ifndef MaxStrSpace
  236. #define MaxStrSpace        65000    /* size of the string space in bytes */
  237. #endif                    /* MaxStrSpace */
  238.  
  239. #ifndef MaxAbrSize
  240. #define MaxAbrSize        65000    /* size of the block region in bytes */
  241. #endif                    /* MaxAbrSize */
  242.  
  243. #ifndef MStackSize
  244. #define MStackSize        10000    /* size of the main stack in words */
  245. #endif                    /* MStackSize */
  246.  
  247. #ifndef StackSize
  248. #define StackSize          2000    /* words in co-expression stack */
  249. #endif                    /* StackSize */
  250.  
  251. #ifndef QualLstSize
  252. #define QualLstSize         5000    /* size of qualifier pointer region */
  253. #endif                    /* QualLstSize */
  254.  
  255. #ifndef ActStkBlkEnts
  256. #ifdef Coexpr
  257. #define ActStkBlkEnts           25    /* number of entries in an astkblk */
  258. #else                    /* Coexpr */
  259. #define ActStkBlkEnts            1    /* number of entries in an astkblk */
  260. #endif                    /* Coexpr */
  261. #endif                    /* ActStkBlkEnts */
  262.  
  263. /*
  264.  * Minimum regions sizes (presently not used).
  265.  */
  266.  
  267. #ifndef MinStatSize
  268. #ifdef Coexpr
  269. #define MinStatSize        10240    /* size of the static region in bytes*/
  270. #else                    /* Coexpr */
  271. #define MinStatSize         1024    /* size of static region in bytes */
  272. #endif                    /* Coexpr */
  273. #endif                    /* MinStatSize */
  274.  
  275. #ifndef MinStrSpace
  276. #define MinStrSpace         5000    /* size of the string space in bytes */
  277. #endif                    /* MinStrSpace */
  278.  
  279. #ifndef MinAbrSize
  280. #define MinAbrSize         5000    /* size of the block region in bytes */
  281. #endif                    /* MinAbrSize */
  282.  
  283. #ifndef MinMStackSize
  284. #define MinMStackSize         2000    /* size of the main stack in words */
  285. #endif                    /* MinMStackSize */
  286.  
  287. #ifndef MinStackSize
  288. #define MinStackSize         1000    /* words in co-expression stack */
  289. #endif                    /* MinStackSize */
  290.  
  291. #ifndef MinQualLstSize
  292. #define MinQualLstSize          500    /* size of qualifier pointer region */
  293. #endif                    /* MinQualLstSize */
  294.  
  295. #ifndef GranSize
  296. #define GranSize                64    /* storage allocation granule size */
  297. #endif                    /* GranSize */
  298.  
  299. #ifndef Sqlinc
  300. #define Sqlinc        128*sizeof(dptr *)     /* qualifier pointer list increment */
  301. #endif                    /* Sqlinc */
  302.